<!DOCTYPE html>
	<html>
	<head>
		<title>{$site_seo_title} {$site_name}</title>
		<meta name="keywords" content="{$site_seo_keywords}" />
		<meta name="description" content="{$site_seo_description}">
		<tc_include file="Public:head" />
		<link href="__TMPL__Public/css/slippry/slippry.css" rel="stylesheet">
    <style type="text/css">
    table {
        background-color: #FCFCFC !important;
        text-align: center !important;
    }
    th {
        text-align: center !important;
        padding-left:2px !important;
        padding-right:2px !important;
        padding-bottom:10px !important;
        padding-top:10px !important;
    }
    td {
	cursor: pointer;
	text-align: center !important;
	padding-left: 2px !important;
	padding-right: 2px !important;
	padding-bottom: 10px !important;
	padding-top: 10px !important;
	border-top-width: 3px !important;
	border-right-width: 3px !important;
	border-bottom-width: 3px !important;
	border-left-width: 3px !important;
	border-top-color: #D4D4D4;
	border-right-color: #D4D4D4;
	border-bottom-color: #D4D4D4;
	border-left-color: #D4D4D4;
	font-size: 12px !important;
	vertical-align: middle;
	font-family: "Times New Roman", Times, serif;
    }
	ol, ul {
		list-style: none;
	}
	hr {
	border-top-color: #CCCCCC;
	border-right-color: #CCCCCC;
	border-bottom-color: #CCCCCC;
	border-left-color: #CCCCCC;
	}
	.order-status {
		border: 1px solid #aaaaaa;
		display: block;
		overflow: hidden;
		width: 16px;
		height: 16px;
	}
	.can-order {
    	background-color:#FAFAFA;
	}
	.can-not-order {
		background-color:#B89B92;
	}
	.chosen {

		background-color:#97BAFB;
	}
	.font12px {
		font-size: 12px !important;
	}
	.echo li {
		margin: 5px 5px;
		border: 1px solid #aaaaaa;
		border-radius: 3px;
		width: 246px;
		height: 30px;
		line-height: 30px;
		font-size: 14px;
		color: #222222;
		font: inherit;
		display: list-item;
		text-align: -webkit-match-parent;
	}
    </style>
	</head>
<body style="padding-top:0px !important;">

<div class="container-fluid">
	<div class="row-fluid" style="padding-top:10px;">
		<div class="span3">
        	<span>当前时间：</span><span id="server_time"></span>
		</div>
		<div class="span3">
        	<span>当前显示场馆：{$cdname}</span>
		</div>
		<div class="span6">
		</div>
	</div>
</div>

{:hook('body_start')}

{$table}

        <div class="row-fluid">
            <div class="span12">
            	
                <ul class="inline">
                  <li><span class="can-order order-status"></span></li>
                  <li class="font12px">可预订</li>
                  <li><span class="can-not-order order-status"></span></li>
                  <li class="font12px">不可预订</li>
                  <li><span class="chosen order-status"></span></li>
                  <li class="font12px">当前选定</li>
                </ul>
                
				<span>当前预订规定 -- {$ydstatus}</span>
                
            </div>
		</div>
<tc_include file="Public:footer" /> 

<!-- JavaScript -->
	<tc_include file="Public:scripts" />
	<script>

        /*取得预订的内容，每3秒刷新一次*/
        function ajax_refresh(){
			var data = new Array();
			//data[0] = mdate.toLocaleFormat();//IE里不能够使用这个来取得日期，这个函数在IE返回的格式不能够让PHP用
			data[0] = '{$mday}';
			//alert("riqi:" + data[0]);
            $.post("{:U('Yd/Yd/ajax_refresh')}",{"refresh":data},function(ret_json_data){
				_data=decodeURIComponent(ret_json_data);
                arr_data=eval('('+_data+')');	//分割json格式为数组
				//清空原来的TD单元格内容
				$(".td_yd").html('');	
				//清空原有的提示框内容
				//$(".td_yd").removeAttr('data-toggle');
				//$(".td_yd").removeAttr('title');
				//清空原有的样式类
				$(".td_yd").removeClass('chosen can-order can-not-order');	
				//alert("ret_data:" + arr_data);
				//console.log(arr_data.toString());
				/*分析数组，将数据显示到每个单元格中*/
				$.each(arr_data,function(n,value) {   
						$.each(value,function(k,v) {   
								obj = $('td#' + v.place_id + '-' + v.opentime_id);
								obj.html(v.xm);
								//增加显示类，有可预订，已预订且不能被预订，已被自己预选
								obj.addClass(v.class);
						}); 
				   
				});  
                //$("#msg2").html(arr_data.toString());
            });
        }

        /*取得服务器时间，每2秒刷新一次*/
        function ajax_get_server_time(){
            var data = new Array();
            $.post("{:U('Yd/Index/ajax_get_server_time')}",{"refresh":data},function(ret_data){
                $("#server_time").html(ret_data);	
            });
        }
    </script>
    <script>
        if (top.location != location) {
            //top.location.href = document.location.href ;
        }
        
        $(function(){
			setInterval(ajax_get_server_time, 2000); //定时器，定时执行AJAX函数读取消息msg2后
            setInterval(ajax_refresh, 3000); //定时器，定时执行AJAX函数取得预订列表
			
			ajax_refresh();//执行，读取并显示预订的表格内容
			
        });//$(function(){
            
    
    </script>
    {:hook('footer_end')}
</body>
</html>